pub fn main(){
    let mut s = String::from("i am the king of the world");
    let cl = "!".to_string();
    s.push_str(&cl);
    // s 并没有获得 cl的所有权
    println!("s={}, cl={}", s, cl);

    let mut s = "my name ".to_string();
    let s2 = "is jack".to_string();
    let s3 = s+ &s2+"-"+"@#"+&s2;
    println!("s3={}, s2 = {}", s3, s2);
    // 报错 s已经被 移动
    // println!("s={}",s);

    let s = "I".to_string();
    let s2 = "O".to_string();
    let s3 = "E".to_string();
    let res = format!("{}{}{}",s,s2,s3);
    let res2 = format!("{}{}",&s,&s2);
    println!("res = {} res2={}", res, res2);

    let s = "Hello李焕英".to_string();
    // 会报错，rust不支持这样的操作
    // let c = s[0];
    println!("s len={}",s.len());
    let cs = s.chars();
    for c in s.chars() {
        println!("{}", c);
    }
}